import { createRouter, createWebHistory } from 'vue-router'
// import data from './data.js'
import index from '@/views/index.vue'

//  1 一级  1-2  二级 1-2-3 三级 1-2-3-4 四级
    
 
const routes = [
    {
        path: '/',
      redirect: '/Home',
    },
    {
        meta: {
            id: "1",
            level: "1",
            name: "首页",
        },
        path: "/Home",
        component: index,
        // 二级菜单————————————————————————
        children: [
            {
                meta: {
                    id: "1-1",
                    level: '1-1',
                    name: '首页',
                },
             
                path: '/Home',
                name: '首页',
                component: () => import('@/views/Home/index.vue'),
               
            },
        
            {
                meta: {
                    id: "1-2",
                    level: '1-2',
                    name: '封装组件',
                },
                
                path: '/Afunction/index',
                component: () => import('@/views/Afunction/index.vue'),
                // 三级菜单——————————————————————————
                children: [
                    {
                        meta: {
                            id: "1-2-1",
                            level: '1-2-1',
                            name: '封装组件2',
                            },
                        path: '/Bfunction/index',
                        component: () => import('@/views/Afunction/Bfunction/index.vue'),
                        // 四级菜单——————————————————————————
                        children: [
                            {
                                meta: {
                                    id: "1-2-1-1",
                                    level: '1-2-1-1',
                                    name: '封装组件3',
                                    },
                                path: '/Cfunction/index',
                                component: () => import('@/views/Afunction/Bfunction/Cfunction/index.vue'),
                                // 五级菜单——————————————————————————
                                children: [
                                    {
                                        meta: {
                                            id: "1-2-1-1-1",
                                            level: '1-2-1-1-1',
                                            name: '封装组件4',
                                            },
                                        path: '/Dfunction/index',
                                        component: () => import('@/views/Afunction/Bfunction/Cfunction/Dfunction/index.vue'),
                                          // 六级菜单——————————————————————————
                                        children: [
                                            {
                                                meta: {
                                                    id: "1-2-1-1-1-1",
                                                    level: '1-2-1-1-1-1',
                                                    name: '封装组件5',
                                                    },
                                                path: '/Efunction/index',
                                                component: () => import('@/views/Afunction/Bfunction/Cfunction/Dfunction/Efunction/index.vue'),

                                            },
                                            {
                                                meta: {
                                                    id: "1-2-1-1-1-2",
                                                    level: '1-2-1-1-1-2',
                                                    name: 'Efunction',
                                                    },
                                                path: '/Efunction',
                                                component: () => import('@/views/Afunction/Bfunction/Cfunction/Dfunction/Efunction/function.vue'),
                                            }
                                        ]
                                    },
                                    {
                                        meta: {
                                            id: "1-2-1-1-2",
                                            level: '1-2-1-1-2',
                                            name: 'Dfunction',
                                            },
                                        path: '/Dfunction',
                                        component: () => import('@/views/Afunction/Bfunction/Cfunction/Dfunction/function.vue'),   
                                        
                                    }
                            
                                ]
                            },
                            {
                                meta: {
                                    id: "1-2-1-2",
                                    level: '1-2-1-2',
                                    name: 'Bfunction',
                                    },
                                path: '/Bfunction',
                                component: () => import('@/views/Afunction/Bfunction/function.vue'),
                            }
                            
                        ]

                    },
                    // ____________________Afunction
                    {
                        meta: {
                            id: "1-2-2",
                            level: '1-2-2',
                            name: 'Afunction',
                            },
                        path: '/Afunction1',
                        component: () => import('@/views/Afunction/function.vue'),
                    },
                    {
                        meta: {
                            id: "1-2-3",
                            level: '1-2-3',
                            name: 'Afunction2',
                            },
                       
                        path: '/Afunction2',
                        component: () => import('@/views/Afunction/function2.vue'),
                    }
                    
                ]
                // children: [
                
                //     {
                //         meta: {
                //             id: "1-2-2",
                //             level: '1-2-2',
                //             name: 'Afunction',
                //             },
                //         path: '/Afunction1',
                //         component: () => import('@/views/Afunction/function.vue'),

                //     },
                //     {
                //         meta: {
                //             id: "1-2-3",
                //             level: '1-2-3',
                //             name: 'Afunction2',
                //             },
                       
                //         path: '/Afunction2',
                //         component: () => import('@/views/Afunction/function2.vue'),
                //     },
                //     // __________________________________________________________
                //     {
                //         meta: {
                //             id: "1-2-1",
                //             level: '1-2-1',
                //             name: '封装组件2',
                //             },
                //         path: '/Bfunction',
                //         component: () => import('@/views/Afunction/Bfunction/index.vue'),
                //         children: [
                //             {
                //                 meta: {
                //                     id: "1-2-1-1",
                //                     level: '1-2-1-1',
                //                     name: 'Bfunction',
                //                     },
                //                 path: '/Bfunction2',
                //                 component: () => import('@/views/Afunction/Bfunction/function.vue'),
                //                 children: [
                //                     {
                //                         meta: {
                //                             id: "1-2-1-1-1",
                //                             level: '1-2-1-1-1',
                //                             name: 'Cfunction',
                //                             },
                //                         path: '/Bfunction/Bfunction/Cfunction',
                //                         component: () => import('@/views/Afunction/Bfunction/Cfunction/index.vue'),
                //                     },
                //                     {
                //                         meta: {
                //                             id: "1-2-1-1-2",
                //                             level: '1-2-1-1-2',
                //                             name: '封装组件3',
                //                             },
                //                         path: '/Bfunction/Bfunction/Cfunction/Dfunction',
                //                         component: () => import('@/views/Afunction/Bfunction/Cfunction/Dfunction/index.vue'),
                //                     }

                //                 ]
                //             },
                //             {
                //                 meta: {
                //                     id: "1-2-1-2",
                //                     level: '1-2-1-2',
                //                     name: 'Bfunction2',
                //                     },
                //                 path: '/Bfunction3',
                //                 component: () => import('@/views/Afunction/Bfunction/function2.vue'),
                //             }
                            
                            
                //         ]
                //     },
                // ]
            }, 
            // _____________________________________
            {
                meta: {
                    id: "1-3",
                    level: '1-3',
                    name: 'Belement',
                },
                path: '/Belement',
                name: 'Belement',
                component: () => import('@/views/Belement/index.vue'),
                children:[]
                // children: [
                //     {
                //         meta: {
                //             id: "1-3-1",
                //             level: '1-3-1',
                //         },
                //         id: "1-3-1",
                //         level: '1-3-1',
                //         path: '/Belement',
                //         name: 'Belement',
                //         component: () => import('@/views/Belement/index.vue'),
                //     }
                // ]
                
            }
            
        ]
    }
    
]
 
const router = createRouter({
    history: createWebHistory(),
    routes
})
 
export default router